package com.bmp.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.bmp.dao.GroupsDao;
import com.bmp.model.Groups;
import com.bmp.service.GroupsManager;

@Component("groupsManager")
public class GroupsManagerImpl implements GroupsManager {
	private GroupsDao groupsDao;

	public GroupsDao getGroupsDao() {
		return groupsDao;
	}

	@Resource
	public void setGroupsDao(GroupsDao groupsDao) {
		this.groupsDao = groupsDao;
	}

	public void addGroups(Groups g) {
		this.groupsDao.insertGroups(g);
	}

	public void deleteGroupsById(int id) {
		this.groupsDao.deleteGroupsById(id);
	}

	public Groups getGroupsById(int id) {
		//System.out.println("getGroupsById");
		return this.groupsDao.getGroupsById(id);
	}

	public void updateGroups(Groups g) {
		this.groupsDao.updateGroups(g);
	}

	public List<Groups> getGroups(int page, int rows) {
		return this.groupsDao.getGroups(page, rows);
	}

	public int getTotalPages() {
		return this.groupsDao.getTotalPages();
	}
}
